error provider c#

86

error provider c# -

private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)  
{  
    ValidateName();  
}  
private bool ValidateName()  
{  
    bool bStatus = true;  
    if (textBox1.Text == "")  
    {  
        errorProvider1.SetError(textBox1, "Please enter your Name");  
        bStatus = false;  
    }  
    else  
        errorProvider1.SetError(textBox1, "");  
    return bStatus;  
}  

Comments

Submit
0 Comments